<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>林思雨专属相册</title>
  <link rel="stylesheet" href="./style.css">
  <link rel="Bookmark" href="/forum_images/ffico.png" />
  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
  <link rel="icon" href="favicon.ico" type="" />
</head>

<body>
  <div class="big-box">
    <div class="box">
      <ul class="minbox">
        <li>
          <img src="./images/11.jpg" alt="">
        </li>
        <li>
          <img src="./images/05.jpg" alt="">
        </li>
        <li>
          <img src="./images/13.jpg" alt="">
        </li>
        <li>
          <img src="./images/14.jpg" alt="">
        </li>
        <li>
          <img src="./images/15.jpg" alt="">
        </li>
        <li>
          <img src="./images/16.jpg" alt="">
        </li>
      </ul>
      <ol class="maxbox">
        <li>
          <img src="./images/18.jpg" alt="">
        </li>
        <li>
          <img src="./images/05.jpg" alt="">
        </li>
        <li>
          <img src="./images/20.jpg" alt="">
        </li>
        <li>
          <img src="./images/17.jpg" alt="">
        </li>
        <li>
          <img src="./images/16.jpg" alt="">
        </li>
        <li>
          <img src="./images/19.jpg" alt="">
        </li>
      </ol>
    </div>
  </div>

  <div class="header">
    <div id="music-container">
      <div id="music-logo">
        <img class="music-icon" src="./images/music-logo.jpg" alt="">
      </div>
      <audio
        class="music-audio"
        src="./music/王铮亮、张靓颖 - 只是没有如果.mp3"
        autoplay
        loop
      >
        <p>你的浏览器可能不支持音乐, 请更换其他浏览器</p>
      </audio>
    </div>
    <div id="next-box">回去吧</div>
  </div>

  <script>
    let musicWhether = false

    // 背景音乐播放
    document.querySelector('#music-logo').addEventListener('click', function () {
      if (!musicWhether) {
        document.querySelector('.music-audio').play()
        // document.querySelector('#music-logo').style.animation = `spinMusicLogo 6s infinite linear`;
        document.querySelector('#music-logo').className = 'start'
        musicWhether = !musicWhether
      } else {
        document.querySelector('.music-audio').pause()
        document.querySelector('#music-logo').className = 'paused'
        musicWhether = !musicWhether
      }
    })

    // 返回上一页
    document.getElementById('next-box').addEventListener('click', function() {
      window.location.href='index.html'
    })

    let maxbox = document.querySelector('.maxbox')
    let maxli = maxbox.querySelectorAll('li')
    // 判断是不是苹果手机
    // console.log('是否是苹果手机', /iPhone/i.test(navigator.userAgent))
    document.querySelector('.box').addEventListener('click', function (e) {
      if (/iPhone/i.test(navigator.userAgent)) {
        maxli.forEach((item, index) => {
          item.classList.add('boxhover')

          switch (index) {
            case 0:
              item.classList.add('boxhoverolli1')
              break;

            case 1:
              item.classList.add('boxhoverolli2')
              break;

            case 2:
              item.classList.add('boxhoverolli3')
              break;

            case 3:
              item.classList.add('boxhoverolli4')
              break;

            case 4:
              item.classList.add('boxhoverolli5')
              break;

            case 5:
              item.classList.add('boxhoverolli6')
              break;

            default:
              break;
          }
        })
      }
      e.stopPropagation()
    })
    // 点击空白处动画
    document.querySelector('.big-box').addEventListener('click', function () {
      if (/iPhone/i.test(navigator.userAgent)) {
        maxli.forEach((item) => {
          item.className = ''
        })
      }
    })
  </script>
</body>

</html>